package com.itcast.utils

import redis.clients.jedis.{Jedis, JedisPool}

object Jpools {
    //初始化池子
  private lazy val jedisPool = new JedisPool(ConfigHandler.redisHost,ConfigHandler.redisPort)
  def getJedis: Jedis ={
    val jedis = jedisPool.getResource
    jedis.select(ConfigHandler.redisdbIndex)
    jedis
  }
}
